/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.star.modules.sys.service;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.jeesite.common.entity.Page;
import com.jeesite.common.service.CrudService;
import com.star.modules.sys.entity.ShHouse;
import com.star.modules.sys.dao.ShHouseDao;
import com.jeesite.modules.file.utils.FileUploadUtils;

/**
 * 房源信息Service
 * @author L
 * @version 2018-09-04
 */
@Service
@Transactional(readOnly=true)
public class ShHouseService extends CrudService<ShHouseDao, ShHouse> {
	
	/**
	 * 获取单条数据
	 * @param shHouse
	 * @return
	 */
	@Override
	public ShHouse get(ShHouse shHouse) {
		return super.get(shHouse);
	}
	
	/**
	 * 查询分页数据
	 * @param page 分页对象
	 * @param shHouse
	 * @return
	 */
	@Override
	public Page<ShHouse> findPage(Page<ShHouse> page, ShHouse shHouse) {
		return super.findPage(page, shHouse);
	}
	
	/**
	 * 保存数据（插入或更新）
	 * @param shHouse
	 */
	@Override
	@Transactional(readOnly=false)
	public void save(ShHouse shHouse) {
		super.save(shHouse);
		// 保存上传图片
		FileUploadUtils.saveFileUpload(shHouse.getId(), "shHouse_image");
	}
	
	/**
	 * 更新状态
	 * @param shHouse
	 */
	@Override
	@Transactional(readOnly=false)
	public void updateStatus(ShHouse shHouse) {
		super.updateStatus(shHouse);
	}
	
	/**
	 * 删除数据
	 * @param shHouse
	 */
	@Override
	@Transactional(readOnly=false)
	public void delete(ShHouse shHouse) {
		super.delete(shHouse);
	}
	
}